const express = require('express');

const app = express();

app.get('/user', (req, res) => {
  // res.header('Access-Control-Allow-Origin', 'http://127.0.0.1:8088');
  res.send({
    name: 'jack',
    age: 20
  });
});


app.get('/list', (req, res) => {
  res.header('Content-Type', 'application/javascript');
  const r = { name: "jack", age: "20" };
  res.send(`
    const data = ${JSON.stringify(r)};
  `);
});

app.listen(3000, () => {
  console.log('http://127.0.0.1:3000');
});